﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace svc
{
    public enum RectStatus
    {
        Free
    }
    public class ParkingSpace
    {
        public ParkingSpace(int x1, int y1, int x2, int y2)
        {
            this.X = x1;
            this.Y = y1;
            this.width = Math.Abs(x2 - x1);
            this.height = Math.Abs(y2 - y1);
        }

        public int ID { get; set; }
        public int X { get; set; }
        public int Y { get; set; }

        public int width, height;
        bool status;
    }
    public class Parking
    {
        public int id;
        public ParkingSpace bbox;
        public ParkingSpace[] zones;
    }

    class ParkingDBMock
    {
        public static void Update(Parking parking)
        {
            //NOT IMPLEMENTED
        }

        public static Parking Read(int id)
        {
            return new Parking()
            {
                id = 0,
                bbox = new ParkingSpace(0, 0, 700, 700),
                zones = new ParkingSpace[]
                {
                    new ParkingSpace(0, 185, 150, 245) {ID = 1},  //smaller
                    new ParkingSpace(0, 245, 150, 305) {ID = 2},  //smaller
                    new ParkingSpace(0, 305, 150, 370) {ID = 3},
                    new ParkingSpace(0, 370, 150, 435) {ID = 4},
                    new ParkingSpace(0, 435, 150, 500) {ID = 5},
                    new ParkingSpace(0, 500, 150, 565) {ID = 6},

                    new ParkingSpace(550, 130, 700, 195) {ID = 7},
                    new ParkingSpace(550, 195, 700, 260) {ID = 8},
                    new ParkingSpace(550, 260, 700, 325) {ID = 9},
                    new ParkingSpace(550, 325, 700, 390) {ID = 10},
                    new ParkingSpace(550, 390, 700, 455) {ID = 11},
                    new ParkingSpace(550, 455, 700, 525) {ID = 12},
                    new ParkingSpace(550, 525, 700, 580) {ID = 13},//smaller
                    new ParkingSpace(550, 580, 700, 645) {ID = 14},


                    new ParkingSpace(270, 130, 345, 270) {ID = 15}, new ParkingSpace(345, 130, 420, 270) {ID = 19},
                    new ParkingSpace(270, 270, 345, 410) {ID = 16}, new ParkingSpace(345, 270, 420, 410) {ID = 20},
                    new ParkingSpace(270, 410, 345, 550) {ID = 17}, new ParkingSpace(345, 410, 420, 550) {ID = 21},
                    new ParkingSpace(270, 550, 345, 690) {ID = 18}, new ParkingSpace(345, 550, 420, 690) {ID = 22}
                }
            };
        }

        internal static void UpdateZones(ParkingSpace[] rect)
        {
            //NOT IMPLEMENTED
        }
    }
}
